package edu.ufop.vaading.helloworld.model;

import java.util.Iterator;
import java.util.Vector;

public class Disciplina {
	
	private String name,id,prof;
	private static Vector<Disciplina> vector = new Vector<Disciplina>();
	
	public Disciplina (String n, String i,String p){
		name = n;
		id = i;		
		prof = p;
	}
	public String getProfessor(){
		return prof;		
	}
	public String toString(){
		return String.format("%s:[%s]",name,id);		
	}
	public static void add(Disciplina d){
		vector.add(d);	
	}
	public static void remove(Disciplina d){
		vector.remove(d);
	}
	public static int find(Disciplina d){
		return vector.indexOf(d);	
	}
	public static void listar(){
		for(Iterator<Disciplina> i = vector.iterator(); i.hasNext(); ){
			System.out.println(i.next().toString());
		}
	}
	public boolean isValid(){
		return vector.contains(this);		
	}

}
